<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%   
String path = request.getContextPath();   
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";   
%> 
<%
	Cookie[] cookies = request.getCookies();
	String name = "";
	String password = "";
	if(cookies!=null){
		for(int i = 0; i < cookies.length; i++) { 
		    Cookie c = cookies[i];
		    if (c.getName().equals("name")) {
		        name = c.getValue();
		    }
		    if (c.getName().equals("password")) {
		    	password = c.getValue();
		    }
		}
	}
%> 
<!DOCTYPE html>
<html>
<head>
    <title>用户登录</title>
    <base href="<%=basePath%>"> 
    <link rel="shortcut icon" href="<%=basePath%>img/favo.ico">
    <link href="css/bootstrap.css" rel="stylesheet">
    <link href="css/todc-bootstrap.css" rel="stylesheet">
    <link href="css/global.css" rel="stylesheet">
    <link href="css/layout.css" rel="stylesheet">
    <link href="css/user.css" rel="stylesheet">
    <script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>
    <script type="text/javascript" src="js/common.js"></script>
</head>
<style>
	.form-title{
		font-size:18px;
		height:32px;
		line-height:32px;
		font-family:'微软雅黑';
		margin-bottom:15px;	
		padding-bottom:7px;
	}
	.form-horizontal .controls{
		margin-left:30px;
	}
	.login.box{
		width:900px;
		margin:auto;
		margin-top:20px;
		padding:20px;
		background:#F9F9F9;
		border-radius: 4px 4px 4px 4px;
		position:relative;
	}
	.login .right{
		margin-left:350px;
		border-left:1px solid #D9D9D9;
	}
	.login .left{
		width:310px;
		height:310px;
		position:absolute;
		top:20px;
		left:30px;
	}
	.login.box input[type='text'],.login.box input[type='password']{
		height:32px;
		line-height:32px;
		font-size:18px;
		font-family:"Helvetica Neue",Helvetica,Arial,sans-serif,'微软雅黑';
	}
</style>

<body>
<jsp:include page="include/topbar.jsp"></jsp:include>
<jsp:include page="include/logobar.jsp"></jsp:include>
<div class="login box">
<div class="left">
	<img src="img/login-left.jpg" />
</div>
<div class="right">
 <form class="form-horizontal" method="POST" action="<%=basePath%>user/login.html">
		<div class="form-title">
	      	<div class="controls" >欢迎来到问问</div>
	    </div>
		<div class="control-group">
			<div class="controls">
				<input name="name" type="text" placeholder="用户名或邮箱地址" class="input-xlarge" value="<%=name %>" />
			</div>
		</div>
		<div class="control-group">
			<div class="controls">
				<input name="password" placeholder="密码" type="password" class="input-xlarge" value="<%=password %>"/>
			</div>
		</div>
		<div class="control-group">
			<div class="controls">
				 <label class="checkbox"><input type="checkbox" name="remember" /> 记住密码</label><br/>
				 <p style="color:red"><%= request.getParameter("errormsg")==null?"":new String(request.getParameter("errormsg").getBytes("ISO-8859-1"),"UTF-8") %></p>
				 <input type="hidden" value="0" name="minilogin">
				 <button type="submit" class="btn btn-success btn-large">登陆</button>
			</div>
		</div>
	 	<input type="hidden" name="redirect" value="<%= request.getParameter("redirect")==null?"":request.getParameter("redirect") %>"><br/>	 	
 </form>
 </div>
</div>
<jsp:include page="include/foot.jsp"></jsp:include>
</body>
</html>